package com.zdk.springcloudlog.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.server.ServerWebExchange;

import javax.servlet.http.HttpServletRequest;

/**
 * @author quavario@gmail.com
 * @date 2021/10/9 10:51
 */
@RestController
@RequestMapping(value = "/api/auto")
public class DemoController {


    @GetMapping(value = "/test")
    public Object test(ServerWebExchange exchange){
        String userId = exchange.getRequest().getHeaders().getFirst("Authorization-userId");
        return userId;
    }

}
